import { createWebHistory, createRouter } from 'vue-router'

import Register from '../views/Register.vue'
import Login from '../views/Login.vue'
import Main from '../views/Main.vue'
import Exam from '../views/Exam.vue'
import Question from '../views/Question.vue'
import My from '../views/My.vue'
import Layout from '../views/Layout.vue'
import FindPass from '../views/FindPass.vue'
import LogList from '../views/LogList.vue'
import ExamQuestion from "../views/ExamQuestion.vue";
import UserInfo from "../views/UserInfo.vue";

export const constantRoutes = [
    {
        path: "/layout",
        component: Layout,
        children:[
            { path: '/main', component: Main, meta:{istrun:true} },
            { path: '/exam', component: Exam, meta:{istrun:true} },
            { path: '/question', component: Question, meta:{istrun:true} },
            { path: '/my', component: My, meta:{istrun:true} },
            { path: '/log', component: LogList },
            { path: '/equestion', component: ExamQuestion },
            { path: '/userinfo', component: UserInfo },
        ]
    },
    { path: '/register', component: Register },
    { path: '/', component: Login },
    { path: '/find', component: FindPass },
]

const router = createRouter({
    history: createWebHistory(),
    routes: [...constantRoutes]
})

export default router;